// utils/common.js
export const showLoading = (title = '加载中...') => {
  uni.showLoading({
    title,
    mask: true
  });
};

export const hideLoading = () => {
  uni.hideLoading();
};

export const showToast = (title, icon = 'none', duration = 2000) => {
  uni.showToast({
    title,
    icon,
    duration
  });
};

export const navigateTo = (url) => {
  uni.navigateTo({ url });
};

export const redirectTo = (url) => {
  uni.redirectTo({ url });
};

export const switchTab = (url) => {
  uni.switchTab({ url });
};

export const reLaunch = (url) => {
  uni.reLaunch({ url });
};